Importance of Variables Semantic in CNF Encoding of Cardinality Constraints
نویسندگان
چکیده
In the satisfiability domain, it is well-known that a SAT algorithm may solve a problem instance easily and another instance hardly, whilst these two instances are equivalent CNF encodings of the original problem. Moreover, different algorithms may disagree on which encoding makes the problem easier to solve. In this paper, we focus on the CNF encoding of cardinality constraints, which states that exactly k propositional variables in a given set are assigned to true. We demonstrate the importance of the semantics of the SAT variables in the encoding of this constraint. We implement several variants of the CNF encoding in which the close semantic variables are grouped. We then examine these new encodings on problems generated from diagnosis of discrete-event system. Our results demonstrate that both stochastic and systematic SAT algorithms can now solve most of the problem instances, which were unreachable before (Grastien et al. 2007). These results also indicate that, on average cases, there is an encoding that suits well both SLS and DPLL algorithms. Introduction The fast growing research in propositional satisfiability (SAT) has a positive impact on solving an increasing number of practical applications, including diagnosis, planning, scheduling, hardware and software verification, among many others. Basically, an application problem will be encoded into a CNF formula, which will then be solved using a SAT solver. It has been shown in SAT planning (Ernst, Millstein, and Weld 1997) that the SAT encoding of a problem can have huge impact on the runtime. This paper focuses on CNF encodings of cardinality constraints, which state that a given number of propositional variables within a specified subset of the variables in the SAT problem is assigned to true. The constraint is defined on a set of variables, and can be encoded by several equivalent ways depending on the order in which the variables are integrated in the constraint. We show that this ordering has a huge impact on the runtime of both SLS and DPLL algorithms. We examine the encoding of cardinality constraints in discrete-event system (DES) diagnosis problems, but this NICTA is funded by the Australian Government as represented by the Department of Broadband, Communications and the Digital Economy and the Australian Research Council. Copyright c © 2009, Association for the Advancement of Artificial Intelligence (www.aaai.org). All rights reserved. result can be generalized to other problems. DES diagnosis is the problem of determining whether the behavior of a system is normal or faulty according to the observations generated by this system. The use of SAT algorithms in better solving the DES diagnosis problems was first proposed in (Grastien et al. 2007), where the results demonstrated that SAT algorithms outperformed the traditional diagnosis algorithms. However, the SAT algorithms were still unable to solve about 30% of the SAT-encoded instances examined in that study (within 1200 seconds each), particularly the diagnosis problem under partially ordered observations. Therefore, in this paper we propose several variants of CNF encodings of cardinality constraints in which the close semantic variables are grouped. Experimental results indicate that both stochastic and systematic SAT algorithms can now solve most of the problem instances, which were unreachable before (Grastien et al. 2007). Another important finding is that, on average cases, there is an encoding that suits well the SAT algorithms. CNF Encoding of Cardinality Constraints The cardinality constraint in a SAT problem is the following: given a set S of n propositional variables, exactly k variables of S are assigned to true, where k ≤ n. The following set of naive rules can be used to encode the constraint into CNF form without auxiliary variables: i) For any subset {v1, . . . , vk+1} of k + 1 variables of S, specify that at least one variable must be assigned to false: ¬v1 ∨ · · · ∨ ¬vk+1. ii) For any subset {v1, . . . , vn−k+1} of n − k + 1 variables of S, specify that at least one variable must be assigned to true: v1 ∨ · · · ∨ vn−k+1. However, it requires n! (k+1)!×(n−k−1)! + n! (k−1)!×(n−k+1)! clauses which makes it impractical for any k > 1. For the special case where k = 1, Marques-Silva and Lynce (2007) proposed an encoding that is better than the naive one. Another encoding method introduced by Bailleux and Boufkhad (2003) and further studied by Sinz (2005) is the one based on a totalizer (also called circuit). The totalizer is a tree (see Figure 2) whose leaves are labeled with the variables of S. The nodes of the tree are labeled with auxiliary variables modeling a number; the constraints on the 10 Proceedings of the Eighth Symposium on Abstraction, Reformulation, and Approximation (SARA2009)
منابع مشابه
A Pigeon-Hole Based Encoding of Cardinality Constraints
In this paper, we propose a new encoding of the cardinality constraint ∑i=1 xi > b. It makes an original use of the general formulation of the Pigeon-Hole principle to derive a formula in conjunctive normal form (CNF). Our Pigeon-Hole based CNF encoding can be seen as a nice and simple way to express the semantic of the cardinality constraint, that can be defined as how to put b pigeons into n ...
متن کاملTowards an Optimal CNF Encoding of Boolean Cardinality Constraints
We consider the problem of encoding Boolean cardinality constraints in conjunctive normal form (CNF). Boolean cardinality constraints are formulae expressing that at most (resp. at least) k out of n propositional variables or formulae are true. We present a unifying framework for a whole family of such encodings encompassing previously proposed solutions. We give two novel encodings that improv...
متن کاملPerfect Hashing and CNF Encodings of Cardinality Constraints
We study the problem of encoding cardinality constraints (threshold functions) on Boolean variables into CNF. Specifically, we propose new encodings based on (perfect) hashing that are efficient in terms of the number of clauses, auxiliary variables, and propagation strength. We compare the properties of our encodings to known ones, and provide experimental results evaluating their practical ef...
متن کاملA Cardinality Solver: More Expressive Constraints for Free - (Poster Presentation)
Despite the semantic simplicity of cardinality constraints, the CNF encodings typically used to solve them invariably turn one constraint into a large number of CNF clauses and/or auxiliary variables. This incurs a significant cost, both in space complexity and in runtime, that could be avoided by reasoning about cardinality constraints directly within a solver. Adding a single, native cardi-na...
متن کاملOn the CNF encoding of cardinality constraints and beyond
In this report, we propose a quick survey of the currently known techniques for encoding a Boolean cardinality constraint into a cnf formula, and we discuss about the relevance of these encodings. We also propose models to facilitate analysis and design of cnf encodings for Boolean constraints.
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2009